mountoperation: Free user_widgets list upon dialog destruction
authorCorey Berla <corey@berla.me>
Mon, 25 Jul 2022 03:55:22 +0000 (20:55 -0700)
committerCorey Berla <corey@berla.me>
Mon, 25 Jul 2022 13:54:14 +0000 (06:54 -0700)
commit111929593aa995c3286b84ad118280357cfe6bdd
treec336c30ce236048bc18526e0d101173c732e5cfc
parentdd5d1030b544187a5ba880be11c719d8ef7e6595
mountoperation: Free user_widgets list upon dialog destruction

There's a list user_widgets that contains all of the entries and
selections during authentication.  This is only freed  upon
finalizing the GtkMountOperation.  It's possible (and true for the
GVFS SMB implementation) that a MountOperation can have the
gtk_mount_operation_ask_password_do_gtk () function called multiple
times (i.e. bad password).  The user_widgets list grows with now
invalid pointers to old widgets (causing unexpected behavior and
seg faults).

Free the user_widgets list upon dialog destruction, we don't need it
anymore.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5059
Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/5058
gtk/gtkmountoperation.c